package com.ghy.service.impl;

import com.ghy.entity.EbProductCategory;
import com.ghy.mapper.ProductCategoryMapper;
import com.ghy.service.ProductClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProductClassServiceImpl implements ProductClassService {
    @Autowired
    private ProductCategoryMapper productCategoryMapper;
    @Override
    public List<EbProductCategory> listByPage(){
        return productCategoryMapper.findByPage();
    }
    @Override
    public EbProductCategory select(Integer epcId){
        return productCategoryMapper.select(epcId);
    }
    @Override
    public EbProductCategory selectByName(String epcName) {
        return productCategoryMapper.selectByName(epcName);
    }
    @Override
    public int save(EbProductCategory ebProductCategory){
        return productCategoryMapper.save(ebProductCategory);
    }
    @Override
    public int delete(Integer epcId){
        return  productCategoryMapper.remove(epcId);
    }
    @Override
    public int deleteAllChild(Integer epcParentId) {
        return productCategoryMapper.deleteAllChild(epcParentId);
    }
    @Override
    public int update(EbProductCategory ebProductCategory){
        return  productCategoryMapper.updateByPrimaryKey(ebProductCategory);
    }
    @Override
    public Integer getMaxPage(Integer pageSize){
        return productCategoryMapper.getMaxPage(pageSize);
    }
}